<?php
App::uses('Component', 'Controller');
class SubjectComponent extends Component {
    public function getListSubject() {
    	$this->Subject = ClassRegistry::init('Subject');
        return $this->Subject->find('all');
    }
    
    public function getSubjectById($sub_id){
    	$this->Subject = ClassRegistry::init('Subject');
    	return $this->Subject->findAllBysub_id($sub_id);
    }
    
    public function getListByListId($listId){
    	$this->Subject = ClassRegistry::init('Subject');
    	return $this->Subject->find('all', array(
    		'conditions' => array("Subject.sub_id IN ($listId)")
    	));
    }
}
?>